<template>
  <div class="main-view">
    <div class="content">
      <div class="title">
        <h1>TUI</h1>
        <p>一个极简的 Vue3 UI 组件库</p>
      </div>
      <div class="a-view">
        <a
          class="path-button"
          href="https://gitee.com/tanyukang/t-ui"
          size="large"
        >
          <Icon name="gitee"></Icon>
          <span>gitee</span>
        </a>
        <a class="path-button" href="/md" theme="primary" size="large">
          <span>起步</span>
          <Icon name="start"></Icon
        ></a>
      </div>
    </div>
    <div class="introduce">
      <div class="introduce-item" v-for="item in introduceList">
        <Icon :name="item.icon"></Icon>
        <p class="title">{{item.title}}</p>
        <p>{{item.introduce}}</p>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import Icon from './components/Icon/Icon.vue';
const introduceList =[
  {
    id:'Vue',
    icon:'vue',
    title:'基于Vue3',
    introduce:'使用了 Vue3 的 Composition API 制作',
  },
  {
    id:'TS',
    icon:'ts',
    title:'基于TypeScript',
    introduce:'源代码采用 TypeScript',
  },
  {
    id:'features',
    icon:'easy',
    title:'代码易读',
    introduce:'组件的源代码格式严格，易读性强',
  },
] 
</script>
<style lang="scss">
.main-view {
  .content {
    height: 50%;
    background-image: linear-gradient(
      180deg,
      $theme-default-active-color -20%,
      $theme-default-color 100%
    );
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-direction: column;
    .title{
      text-align: center;
      font-weight: bold;
      color: white;
      h1{
        font-size: 100px;
        color: $theme-default-color;
        animation: shake-baidu 2s ease 0s infinite;
        animation-play-state: paused;
      }
      h1:hover{
        animation-play-state: running;
      }
    }
    .a-view {
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .path-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      padding: 12px 0;
      margin: 0 20px;
      width: 128px;
      transition: all 0.3s;
      text-decoration: none;
      outline: none;
      cursor: pointer;
      .icon {
        width: 20px;
        height: 20px;
        margin: 0 8px;
      }
      span {
        font-size: 16px;
        line-height: 20px;
        font-weight: bold;
      }
    }
    .path-button:nth-child(1) {
      background: transparent;
      border: 2px solid $theme-default-color;
      color: white;
    }
    .path-button:nth-child(2) {
      background: $theme-default-color;
      border: 2px solid $theme-default-color;
      color: white;
    }
    .path-button:hover {
      background-color: $theme-default-active-color;
      border: 2px solid $theme-default-active-color;
    }
  }
  .introduce{
    display: flex;
    justify-content: space-around;
    margin-top: 5%;
    .introduce-item{
      width: 300px;
      text-align: center;
      .icon{
        width: 100px;
        height: 100px;
      }
      .title{
        font-weight: bold;
        font-size: 18px;
        line-height: 2;
      }
    }
  }
  @keyframes shake-baidu {
    from    { transform: rotate(0deg); }
    4%      { transform: rotate(5deg); }
    12.5%   { transform: rotate(-5deg); }
    21%     { transform: rotate(5deg); }
    29%     { transform: rotate(-5deg); }
    37.5%   { transform: rotate(5deg); }
    46%     { transform: rotate(-5deg); }
    50%,to  { transform: rotate(0deg); }
  }
}
</style>
